package com.gaff.emp.core.modules.sys.controller.log;

import com.gaff.emp.core.R;
import com.gaff.emp.core.modules.auth.annotation.Auth;
import com.gaff.emp.core.modules.sys.service.SysLogService;
import com.gaff.emp.core.syslog.annotation.SysOperaLog;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;


@Slf4j
@RestController
@RequestMapping("/sys/log")
public class SysLogController {

    @Autowired
    private SysLogService sysLogService;

    @GetMapping("/list")
    @ApiOperation("分页获取日志列表")
    @SysOperaLog(value = "分页获取日志列表", isPersistence = false)
    @Auth(perm = "log")
    public R list(@RequestParam Map<String, Object> params) {
        return R.ok(sysLogService.queryLogsByPage(params));
    }

}
